package com.zhouxiaoge.hello.controller;

import com.zhouxiaoge.hello.HelloService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class HelloController {

    @Resource
    private HelloService helloService;

    @GetMapping("/hello/{name}")
    public String hello(@PathVariable("name") String name) {
        return helloService.sayHello(name);
    }

    @GetMapping("/info")
    public String info() {
        return helloService.helloWorld();
    }

    @GetMapping
    public String index() {
        return "周小哥";
    }
}
